home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 2010 April
/
PCWorld0410.iso
/
pluginy Firefox
/
14642
/
14642.xpi
/
chrome
/
modules
/
trackers
/
bookmark.js
next >
Wrap
Text File
|
2009-10-19
|
2KB
|
50 lines
/* Copyright 2009, Boomtango.com. All Rights Reserved. */
/* contact.js
* Responsible for tracking hContacts on pages
*/
var EXPORTED_SYMBOLS = ["bookmark"];
var bookmark = {
name: "Bookmark",
name_plural: "Bookmarks",
color: "#5F2018",
isInternal: true,
onLoadTracks: function(url, doc){
var result = [];
var bmsvc = Components.classes["@mozilla.org/browser/nav-bookmarks-service;1"].
getService(Components.interfaces.nsINavBookmarksService);
var ios = Components.classes["@mozilla.org/network/io-service;1"].
getService(Components.interfaces.nsIIOService);
var uri = ios.newURI(url, null, null);
this.url = url;
this.isbookmarked = bmsvc.isBookmarked(uri);
if(this.isbookmarked){
result.push(
{
type: "bookmark"
}
);
}
return result;
},
onUnloadTracks: function(url, doc){
var result = [];
if(!this.isbookmarked && this.url == url){
var bmsvc = Components.classes["@mozilla.org/browser/nav-bookmarks-service;1"].
getService(Components.interfaces.nsINavBookmarksService);
var ios = Components.classes["@mozilla.org/network/io-service;1"].
getService(Components.interfaces.nsIIOService);
var uri = ios.newURI(url, null, null);
if(bmsvc.isBookmarked(uri)){
result.push(
{
type: "bookmark"
}
);
}
}
return result;
}
};